package com.qlyl.modules.information.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.qlyl.common.aspect.annotation.Dict;
import lombok.*;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelIgnore;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Data
@TableName("eth_transaction")
public class EthTransaction {

    @TableId(type = IdType.ID_WORKER_STR)
    @TableField(value = "transaction_hash")
    @Excel(name = "交易哈希", width = 15)
    private String transactionHash;

    @Excel(name = "上链状态", width = 15,dicCode = "onChain_status")
    @Dict(dicCode = "onChain_status")
    private Integer status;

    @Excel(name = "app用户ID", width = 15)
    private String userId;

    @Excel(name = "企业ID", width = 15)
    @TableField(value = "comsums_id")
    private String comsumsId;


    @Excel(name = "上链信息", width = 15)
    private String data;

    @TableField(value = "create_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "创建时间", width = 15,format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @TableField(value = "success_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "成功上链时间", width = 15,format = "yyyy-MM-dd HH:mm:ss")
    private Date successTime;

    @ExcelIgnore
    @TableField(exist = false)
    private Consumers consumers;
}
